package com.demo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController

@RequestMapping("test")
public class Controller {
    private static final Logger logger = LoggerFactory.getLogger(Producer.class);

    @Autowired
    private Producer producer;

    @RequestMapping("/send")
    public String send(@RequestParam("msg")String msg){
        producer.sendMessage(msg);
        return "success";
    }


    @RequestMapping("/log")
    public String log(@RequestParam("msg")String msg){
        logger.info("进入log方法，入参如："+ msg);
        logger.info("log方法结束 入参："+ msg);
        return "success";
    }

}
